﻿using System;
using com.guojin.core.io;
using com.guojin.core.io.message;
using System.Collections.Generic;
using com.guojin.mj.net.message.login;

namespace com.guojin.mj.net.message.club
{
    public class ClubInvitPLayerJoinGameRet : Message
    {
        public static int TYPE = 7;
        public static int ID = 52;

        private string _avatar;  //发起邀请人的头像地址;
        private string _name;  //发起邀请人的name;
        private string _roomId;  //邀请进入的房间
        private List<OptionEntry> _options = new List<OptionEntry>();   //房间的规则信息

        public string Avatar
        {
            get
            {
                return _avatar;
            }

            set
            {
                _avatar = value;
            }
        }

        public string Name
        {
            get
            {
                return _name;
            }

            set
            {
                _name = value;
            }
        }

     

        public List<OptionEntry> Options
        {
            get
            {
                return _options;
            }

            set
            {
                _options = value;
            }
        }

        public string RoomId
        {
            get { return _roomId; }
            set { _roomId = value; }
        }

        public void decode(Input _in)
        {
            Avatar =_in.readString();
            Name = _in.readString();
            RoomId = _in.readString();

            int len = _in.readInt();
            if (len > 0)
            {
                for (int i = 0; i < len; i++)
                {
                    OptionEntry oe = new OptionEntry();
                    oe.decode(_in);
                    Options.Add(oe);
                }
            }
        }

        public void encode(Output _out)
        {
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return string.Format("avatar= {0}， name= {1}, roomIDTex= {2}, options= {3}",_avatar, _name,RoomId,_options);
        }
    }
}